import Vue from 'vue'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import '@/assets/style/transition.css'
import '@/assets/dist/ol.css'
import App from './App.vue'
import router from './router'
import store from './store'
//导入权限拦截
import '@/permission.js';
//表格页脚
import Pagination from "@/components/Pagination";
import { parseTime,dealTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, download, handleTree,resetOptions,getOptionsVal } from "@/utils/methodConf";
import { Notification, MessageBox, Message } from 'element-ui'
import '@/assets/style/style.scss'
import { regionData, CodeToText } from 'element-china-area-data' //地址选择
//指令导入
import permission from './directive/permission'
import "lib-flexible-computer";
import '@/assets/dist/ol-debug.js';
import VideoPlayer from 'vue-video-player'
import 'vue-video-player/src/custom-theme.css'
import 'video.js/dist/video-js.css'
// echarts
import echarts from 'echarts'
Vue.prototype.echarts = echarts;
//弹窗移动
import '@/assets/dist/dialog.js'

Vue.prototype.msgSuccess = function (msg) {
  this.$message({ showClose: true, message: msg, type: "success" });
}

Vue.prototype.msgError = function (msg) {
  this.$message({ showClose: true, message: msg, type: "error" });
}

Vue.prototype.msgInfo = function (msg) {
  this.$message.info(msg);
}
Vue.prototype.baseUrl = process.env.VUE_APP_BASE_API;
Vue.prototype.MessageBox = MessageBox
Vue.prototype.Message = Message
Vue.prototype.Notification = Notification
Vue.prototype.parseTime = parseTime
Vue.prototype.dealTime = dealTime
Vue.prototype.resetForm = resetForm
Vue.prototype.addDateRange = addDateRange
Vue.prototype.selectDictLabel = selectDictLabel
Vue.prototype.selectDictLabels = selectDictLabels
Vue.prototype.download = download
Vue.prototype.handleTree = handleTree
Vue.prototype.resetOptions = resetOptions
Vue.prototype.getOptionsVal = getOptionsVal
Vue.prototype.regionData =  regionData

Vue.prototype.addressToText=(data)=>{
  let address = data?CodeToText[data[0]]+CodeToText[data[1]]+CodeToText[data[2]]:"";
  return address
}

Vue.config.productionTip = false

Vue.use(VideoPlayer)
//挂在全局组件 分页组件
Vue.component('Pagination', Pagination)
Vue.use(ElementUI);
Vue.use(permission)//注册指令
window.vueContent = new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
